import Vue from 'vue'
import Vuex from 'vuex'


import createPersistedState from 'vuex-persistedstate'

import theme from './theme.js'
import home from './home.js'

Vue.use(Vuex)


const store = new Vuex.Store({
	 modules:{
		 theme,
		 home
	 },
    plugins:[
			createPersistedState({
						storage: { // 存储方式定义  
							getItem: (key) => uni.getStorageSync(key), // 获取  
							setItem: (key, value) => uni.setStorageSync(key, value), // 存储  
							removeItem: (key) => uni.removeStorageSync(key) // 删除  
						}
					})
		]
})

export default store